import numpy as np

a = np.array([1, 2, 3])
b = np.array([4, 5, 6])
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a ** 2)
print(a ** b)

a = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
b = np.array([[4, 5, 6], [7, 8, 9], [1, 2, 3]])
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a @ b)  # 矩阵乘法

a = np.array([1, 2, 3])
b = np.array([[4], [5], [6]])
print(a + b)
print(a - b)
print(a * b)
print(a / b)
